<%@ page language="java" contentType="text/html; charset=utf8"
	pageEncoding="utf8"%>

<%
	request.setCharacterEncoding("utf8");
%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf8">
<title>修改信息</title>
<link type="text/css" rel="stylesheet" href="css/theme1.css">
</head>
<body>
	<h1>修改信息</h1>

	<form action="mana?action=update" method="post" onsubmit="return f()">
		<div class="bd">
			<label for="inputID">&nbsp;&nbsp;ID&nbsp;&nbsp;</label> 
			<input name="id" type=text value="${wish.id}" id="inputID" readonly>
		</div>
		<div class="bd">
			<label for="inputBookname">&nbsp;书名&nbsp;</label> 
			<input type=text name="bookname" value="${wish.bookname}" id="inputBookname" required>
		</div>
		<div class="bd">
			<label for="inputAuthor">&nbsp;作者&nbsp;</label> 
			<input type=text name="author"
				value="${wish.author}" id="inputAuthor" required>
		</div>
		<div class="bd">
			<label for="inputPublisher">出版社</label> 
			<input type=text
				name="publisher" value="${wish.publisher}" id="inputPublisher" required>
		</div>
		<div class="bd">
			<label for="inputAmount">&nbsp;数量&nbsp;</label> <input type=text name="amount"
				value="${wish.amount}" id="inputAmount" required>
		</div>
		<div class="bd">
			<label for="inputComment">&nbsp;备注&nbsp;</label> 
			<input type=text name="comment"
				value="${wish.comment}" id="inputComment">
		</div>
		<div class="bd">
			<label for="inputDate">&nbsp;日期&nbsp;</label> 
			<input type=text name="date"
				value="${wish.date}" id="inputDate">
		</div>
		<button type="submit" name="submit">提交</button>
	</form>
		<script>
	function f(){
		var x=document.getElementById("inputAmount").value;
		if(x==""||isNaN(x))
		{
			alert("数量的值不是数字，请重新输入");
			return false;
		}
	    if (document.getElementById("inputBookname").value.length>50) {
	    	alert("书名长度不能超过10，请重新输入");
	    	return false;
	    }
	    if (document.getElementById("inputAuthor").value.length>20) {
	    	alert("作者长度不能超过20，请重新输入");
	    	return false;
	    }
	    if (document.getElementById("inputPublisher").value.length>30) {
	    	alert("出版社长度不能超过30，请重新输入");
	    	return false;
	    }
	}
	</script>
</body>
</html>